package com.jiang.myfm.adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jiang.myfm.fragment.BillboardInfoFragment;

import java.util.List;

/**
 * Created by Administrator on 2016/12/8.
 */
public class BillboardInfoAdapter extends FragmentPagerAdapter {

    private List<String> titleList;
    private String contentType;
    private List<String> keyList;

    public BillboardInfoAdapter(FragmentManager fm, List<String> titleList,String contentType,List<String> keyList) {
        super(fm);
        this.titleList = titleList;
        this.keyList = keyList;
        this.contentType = contentType;
    }

    @Override
    public Fragment getItem(int position) {
        return BillboardInfoFragment.newInstance(contentType,keyList.get(position));
    }

    @Override
    public int getCount() {
        return titleList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titleList.get(position);
    }
}
